package com.iknow.xmpp.smack.caps;

import org.jivesoftware.smack.packet.PacketExtension;

public class CapsExtension
  implements PacketExtension
{
  private String mExt;
  private String mHash;
  private String mNode;
  private String mVer;

  public CapsExtension(String paramString1, String paramString2, String paramString3)
  {
    this.mHash = paramString1;
    this.mNode = paramString2;
    this.mVer = paramString3;
  }

  public String getElementName()
  {
    return "c";
  }

  public String getExt()
  {
    return this.mExt;
  }

  public String getHash()
  {
    return this.mHash;
  }

  public String getNamespace()
  {
    return "http://jabber.org/protocol/caps";
  }

  public String getNode()
  {
    return this.mNode;
  }

  public String getVer()
  {
    return this.mVer;
  }

  public void setExt(String paramString)
  {
    this.mExt = paramString;
  }

  public void setHash(String paramString)
  {
    this.mHash = paramString;
  }

  public void setNode(String paramString)
  {
    this.mNode = paramString;
  }

  public void setVer(String paramString)
  {
    this.mVer = paramString;
  }

  public String toXML()
  {
    StringBuilder localStringBuilder = new StringBuilder("<");
    localStringBuilder.append(getElementName());
    localStringBuilder.append(" xmlns=\"").append(getNamespace()).append("\" ");
    if (this.mHash != null)
      localStringBuilder.append("hash=\"").append(this.mHash).append("\" ");
    if (this.mNode != null)
      localStringBuilder.append("node=\"").append(this.mNode).append("\" ");
    if (this.mVer != null)
      localStringBuilder.append("ver=\"").append(this.mVer).append("\" ");
    if (this.mExt != null)
      localStringBuilder.append("ext=\"").append(this.mExt).append("\" ");
    localStringBuilder.append("/>");
    return localStringBuilder.toString();
  }
}